feat: #76 crate page: list the albums you saved #78
+2,718
−254
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Client half of #76. The server half (resolver, paging, tests) is #77.
What was done
MY_CRATEoperation plus a/crateroute, lazy-loaded like the album page. The header gets a "Your crate" link witharia-current="page", and Discover no longer claims to be the current page when you are on the crate.AlbumCardandCrateButton, so a saved album looks exactly like it did in the results.myCratecache policy:keyArgs: false(one crate per user, and the user id never enters the cache key), a first page replaces the list, a continuation appends and deduplicates.CrateButtonevictsmyCrateafter add or remove. Without that the crate page keeps its own cached list and shows an album the user just removed.role="status"on the summary line, and a Load more button while there are more pages. The crate uses the button rather than infinite scroll: a personal list is short, and it does not need to fire requests while the user reads.What was tested
Three component tests (mocked Apollo): the list renders with its count and a Remove control, the empty state offers the way back, and an axe-core run over the populated page.
The axe test caught something real: heading-order. The page h1 was followed by the album cards' h3. Adding an h2 for the list fixed it, and the test now asserts axe examined something before asserting it found no violations.
pnpm format:check && pnpm lint && pnpm typecheck && pnpm buildpasses. The lazy route splits out toCratePage-*.js 2.08 kB, and the main bundle is unchanged in size class (373.88 kB raw / 115.26 kB gzip, inside the 512 000-byte budget).Note on the stack
This is the third PR in a stack, which is what the workflow document allows, but the merge order matters more than usual here. If it is easier to review as one change, say so and I will combine #77 and this one.
docs/architecture.mddecision 5 is updated in #77, not here, so the decision record and the resolver land together.